The purpose of the Edit Logical Expression dialog box is to allow the user to create or edit the logical expression for either Expression A or Expression B in the Model Skip Rules Editor. Users access the Edit Logical Expression dialog box by clicking the Edit button from the Model Skip Rules Editor for either Expression A or Expression B.

Model Skip Rules Editor, Edit Logical Expression panel, Edit button opens the Edit Logical Expression dialog box.

Overview

From the Edit Logical Expression dialog box the user will build Expression A and Expression B for the logical expression that is being created for a model alternative. The Build Logical Expression table in the Edit Logical Expression dialog box, contains two columns, Row and Expression

Edit Logical Expression dialog box.

Below the Build Logical Expression table there is a row of command buttons. The buttons are enabled or disabled based on the state of the expression (built or not built) and the selected row in the Build Logical Expression table. Initially three commands are active from the Edit Logical Expression dialog boxOperator, Table Lookup, and Scalar. As an expression is built and subsequent rows are selected in the Build Logical Expression table, the other commands become available – Time Series, Time Window, and Delete

Edit Logical Expression dialog box, displaying the Initial Commands.

Note

When building a logical expression, note that the contents of a row selected in the Build Logical Expression table affect where a command is placed.


Specifically, if a selected row in the Build Logical Expression table contains **Not Set**, the command will be placed on that row, and if a selected row contains anything other than **Not Set**, the command will be placed one row above the selected row. The following sections provide details on each of the individual command buttons.

Operator 

The Operator command is used to select the maximum (MAX), average (AVG) or minimum (MIN) value of a designated dataset for the logical expression comparison. When the user selects Operator, a row is added to the Build Logical Expression table with the default value of MAX(. The user can change this default operator from the Operator list. Be sure the row with MAX( is highlighted so the Operator list will display on the Edit Logical Expression dialog box.

Edit Logical Expression dialog box, Operator list.

Once the desired operator is specified, the user then selects the row in the Build Logical Expression table inside the operator parentheses labeled **Not Set** to define the source of information used for comparison. Three commands for source data are available: Time Series, Time Window, and Table Lookup

Table Lookup 

Table Lookup allows the user to define a set of related data (e.g., a hydraulic rating curve), and is used to look up a dependent variable based on an independent variable. Two actions are needed to configure the Table Lookup option: define the contents of the lookup table and define a logical expression that specifies the independent variable.

First Table Lookup

The first Table Lookup action is to define the contents of the lookup table. When Table Lookup is selected, a row is added to the Build Logical Expression table with the LOOKUP@ expression and the interface is updated to present the user with two options for entering tabulated data from the Table Type list – User Table and DSS Table. For either option, the user can optionally enter a name in the Table Name box.

User Table

  • The User Table option allows for the manual entry of X and Y values, with X as the independent variable and Y as the dependent variable. The number of rows in the table can be expanded by right-clicking inside the table for a shortcut menu of table editing options.
    Edit Logical Expression dialog box, Table Lookup, User Table option selected.

DSS Table

  • The DSS Table option allows the user to select a DSS file (click Select, the Select Time Series dialog box opens) for the reference table in the same manner as described in Time Series.
    Edit Logical Expression dialog box, Table Lookup, DSS Table option selected.

Second Table Lookup 

The second Table Lookup action is to define a logical expression that specifies the independent variable, click Operator. The MAX operator is added to the Build Logical Expression table.

For the example provided for Without Project Conditions-TimeWindow (simulation), FC - St. Paul Levee (model alternative), the Table Lookup command (LOOKUP@ expression entered for Row 1) is using the maximum value (MAX( expression entered in Row 2) from the time series (Time Series selected for Row 3) referenced in the MAX command as the independent variable. To select the independent variable for Row 3 select the Time Series from Model option from the Time Series Expression list. From the Select Time Series panel, select the model alternative that contains the time series of interest (e.g., HS - St. Paul Levee 30years). The Time Series box updates with a list of available time series data for the selected model alternative. From the Time Series box select the time series data of interest (e.g., Upstream Boundary Conditions - Flow). Click Apply, the row (e.g., Row 3) in the Build Logical Expression table that contains the independent variable updates to display the time series information for the independent variable.

Edit Logical Expression dialog box, displaying an example of using the Table Lookup action for defining a logical expression using a Time Series expression.

Scalar 

The Scalar command allows the user to specify a constant value (default). From the Scalar Expression list, select Constant. In the Constant box, enter the desired value (default is 0). To add the scalar value to the Build Logical Expression table, click Save or Apply.

Edit Logical Expression dialog box, Scalar, Constant option selected.

Time Series 

The Time Series option allows the user to reference a time series of data in a logical expression. From the table on the Edit Logical Expression dialog box, make sure the row with **Not Set** has been selected, click Time Series, the interface will change. The Time Series Expression list contains two options – DSS from File or Time Series from Model.

Note that a Time Series can only be added to the expression inside an Operator (e.g., maximum).

DSS from File

For the DSS from File option, the user can select a DSS file and pathname by clicking Select

Edit Logical Expression dialog box, Time Series, DSS from File option.

Select Time Series

The Select Time Series dialog box opens. To set the DSS file and pathname, click Open Select Time Series dialog box, toolbar Open button.. From the Open HEC-DSS File browser window, navigate to the DSS file location and click Open. From Select Time Series dialog box, from the table select the appropriate record and click Select. The Select Time Series dialog box closes, and the selected information will display on the Edit Logical Expression dialog box, in the File box and the Path box. The Build Logical Expression table can be updated to display the Time Series by clicking Save or Apply on the Edit Logical Expression dialog box.

Select Time Series dialog box, example DSS file and record selected.

Time Series from Model

The Time Series from Model option allows the user to select time series data from model alternatives that are part of the FRA simulation. From the Select Time Series panel, from the Model list, select the appropriate model alternative (e.g., the HEC-ResSim model alternative, calibrate). The Time Series list displays the time series data available from the selected model alternative. Select a single time series to include in the logical expression, click Apply, the selected time series will be added to the Build Logical Expression table.

Edit Logical Expression dialog box, Time Series, Time Series from Model option.

Time Window 

The Time Window can only be added to the expression inside an Operator and allows the user to apply an Operator to a portion or subset of a time-series. For example, the user can find the maximum flow between two dates of interest, as specified by the time window.

From the Build Logical Expression table on the Edit Logical Expression dialog box, make sure the row with **Not Set** has been selected, click Time Window, and the Edit Logical Expression dialog box updates. In the Build Logical Expression table a row is added with the TIMEWINDOW expression.

The bottom part of the Edit Logical Expression dialog box updates with Start and End panels. The Start and End of the time window provides three options – Dss Record, Model's Compute Window, and Specified. These options can be selected independently for the start and end dates and times. For example, the user could select Dss Record for Start and Specified for End.

In addition to specifying a source for both the start and end of a time window, the user must also specify a time series for application of the Operator. For example, a MAX Operator could be applied to a stage time series from HEC-RAS or a flow time series from the Hydrologic Sampler to find the maximum stage or flow, respectively, within a given time window. The time series is specified by selecting the row immediately below the TIMEWINDOW row in the logical expression, which activates the Time Series command. Refer to Time Series for details on how to select a time series from a DSS file. 

Dss Record

The Dss Record option bases the start or end date and time on a user-specified DSS record. In this case, the DSS record selected to provide the time series data for the Operator is also used to set the time window start or end time.

Edit Logical Expression dialog box, Time Window command selected.

Model's Compute Window

The Model's Compute Window bases the start or end date and time on the compute window of the selected model alternative. The selected model alternative is identified on the Edit Logical Expression dialog box, along with the name of the FRA simulation. If a Time Window Modifier has been applied to the selected model alternative, the Model's Compute Window option will reference the modified time window associated with that model alternative.

Specified

The Specified option allows the user to enter a specific date and time for either the Start or End time. For both the Start and End panels there are Date and Time boxes. The date should be entered in DDMMM format (e.g., 10Jan) or selected from a calendar, from the right of the Date box click Open Calendar button, a calendar window will open from which the user can select a date (although year is displayed in the calendar, it is not used in the Date box or computations). The time should be entered in 24-hour format (e.g., 1630).

Note: If the Time Series Expression value is Time Series from Model, the time window specified in this editor must be within the hydrologic event time window so that hydrologic data exists for the compute. Alternatively, if the Time Series Expression value is DSS from File, the specified time window has to be within the selected DSS time series record's time window. If either of these conditions is violated, HEC-WAT will return an error noting the mismatch of time window and availability of data.

Note: The Specified option is most commonly used when hydrologic events span full years; otherwise an error related to lack of required hydrologic data is possible.  

Edit Logical Expression dialog box, Time Window command, Specified time window soure option.

Delete 

The Delete option can be used to delete one or more highlighted rows from the expression.

Save and Close

The Save or Apply buttons adds the selected and defined command (e.g., MAX operator) to the row selected in the Build Logical Expression table (e.g., Row 1).

Edit Logical Expression dialog box.

Click OK to save all changes and close the Edit Logical Expression dialog box. The user is returned to the Model Skip Rules Editor and the created expression (e.g., MAX(ResSim:Baseline_F[Guerneville Gage - Flow])) is displayed in the relevant expression box (e.g., Expression A box).

Model Skip Rules Editor, displaying an example logical expression created from the Edit Logical Expression dialog box.